package com.tiger.ebenv.sample2;

import java.rmi.RemoteException;

import javax.ejb.CreateException;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class Client {

	public static void main(String arg[]) {
		try {
			InitialContext ctx = new InitialContext();
			WebMailHome webMailHome = (WebMailHome) ctx.lookup("comp/env/ejb/WebMailBean");
			WebMail webMail = webMailHome.create();
			webMail.sendMail("a-nishiyama@goo.jp", "test", "now Test!!");
			System.out.println("Mail Sending");
		} catch (NamingException e) {
			e.printStackTrace();
		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (CreateException e) {
			e.printStackTrace();
		}
	}

}
